#ifndef FORTRESS_MAPCONTROLLER_H
#define FORTRESS_MAPCONTROLLER_H

#include <vector>

#include <boost/archive/text_oarchive.hpp>

namespace fortress
{
	class map;
	struct portal;

	class mapController
	{
	private:
		friend class boost::serialization::access;
		template<class Archive>
		void serialize(Archive & ar, const unsigned int version);
		std::vector<map*> gameMaps;
		mapController(const mapController &);             // intentionally undefined
		mapController & operator=(const mapController &); // intentionally undefined
	public:
		mapController();
		~mapController();

		// Generates a new map from the information in the map that it likely connects to.
		// It is very possible that a specific portal has a script associated with it
		// Returns the int mapId so that the map object that calls this function will know where to connect its portal to
		portal * generateMap(portal * fromPortal);
		portal * firstMap();
		// Returns a reference to the requested map.
		// Assumes the requested mapId exists. If not, it throws std::out_of_range
		map & getMap(int mapId) const;
		void loadData();

	};
};

#endif